﻿namespace Jsl.StyleCop.CSharp
{
    /// <summary>
    /// The different states that the <see cref="CodeUnitGraphHelper.SearchCodePaths"/> and
    /// <see cref="CodeUnitGraphHelper.SearchChildCodePaths"/> can return.
    /// </summary>
    public enum GraphSearchState
    {
        /// <summary>
        /// The item was found and the search was stopped.
        /// </summary>
        Found,

        /// <summary>
        /// The item was not found and the search was stopped.
        /// </summary>
        NotFound,

        /// <summary>
        /// Searching should continue as normal.
        /// </summary>
        ContinuePath,

        /// <summary>
        /// The current path is no longer interesting. Back up and continue searching other paths.
        /// </summary>
        StopPath,

        /// <summary>
        /// The code path circled back on itself. Searching this path was stopped.
        /// </summary>
        /// <remarks>
        /// This value should only be used by the search utility itself. Use <see cref="GraphSearchState.StopPath"/>
        /// if you want to stop searching the current path.
        /// </remarks>
        HitEarlierItem
    }
}